/*
 * MyParserXml.h
 *
 *  Created on: Feb 22, 2011
 *      Author: MongKieu
 */

#ifndef MYPARSERXML_H_
#define MYPARSERXML_H_

#include "../Model/DiaDiem.h"
#include "../Ui/WeatherForm.h"
#include "../Ui/WeatherInfoForm.h"
#include "../Model/MyCurrentWeather.h"
#include <FBase.h>
#include <FUi.h>
#include <FXml.h>
#include <FIo.h>
#include <FText.h>

class MyViTriYeuThich
{
public:
	Osp::Base::String __pLat;
	Osp::Base::String __pLng;
	Osp::Base::String __pTieuDe;
	Osp::Base::String __pChuThich;
	MyViTriYeuThich();
	~MyViTriYeuThich();
};

class MyPlaceMark {
public:
	Osp::Base::String __pAddress;
	Osp::Base::String __pCoordinates;
	MyPlaceMark();
	~MyPlaceMark();
};

class DiaDiemKetXe
{
public:
	Osp::Base::String __pTenDiaDiem;
	Osp::Base::String __pLat;
	Osp::Base::String __pLng;
	Osp::Base::String __pLoaiThongTin;
	DiaDiemKetXe();
	~DiaDiemKetXe();
};

using namespace Osp::Base::Collection;

class MyParserXml {
public:
	MyParserXml();
	virtual ~MyParserXml();
	Osp::Xml::xmlDocPtr pDocument;
	char *strPath;
public:
	result OpenXml(char*path);
	result Close(char*);
	Osp::Base::Collection::ArrayList* MoFile(char*);
	result AddNewNode(char*, char*, char*);
	result AddNewNode(char *strPath, char* strNodeName,Osp::Base::String strNodeText);

	/*Lay thoi tiet trong ngay , va du bao trong tuan*/
	LinkedListT<MyCurrentWeather*>* ThoiTietDuBaoTrongTuan(char *strPath);
	//Osp::Base::Collection::LinkedListT<MyCurrentWeather*> * ThoiTietDuBaoTrongTuan(char *strPath);
	MyCurrentWeather* ThoiTietTrongNgay(char*strPath);
	bool haveInfoWeather;
	bool checkHaveInfoWeather();
	/*Lay mang*/
	Osp::Graphics::Bitmap* LoadImageN(Osp::Base::String FileName);
	int getViTriDuongDan(Osp::Base::String path);
	Osp::Base::Collection::LinkedListT<DiaChi>* layGiaTriVaoMangPlaceMarkN(char * giatri);
	result AddNewNodeWithArray(char *strPath,Osp::Base::Collection::ArrayList *strNodeName,
		Osp::Base::Collection::ArrayList* strNodeText, char* nameNode);
	char*GetCStringN(const Osp::Base::String& sBadaStr);
	/*Lay mang vi tri yeu thich*/
	Osp::Base::Collection::LinkedListT<MyViTriYeuThich*>*getLayMangViTriYeuThich(char * strPath);
	//Lay Mang Ket Xe
	Osp::Base::Collection::LinkedListT<DiaDiemKetXe*>*getLayMangDiaDiemKetXe(char *strPath);
	/*Xoa mot node trong xml*/
	bool xoaNodeInXml(char*strPath, Osp::Base::String myLat, Osp::Base::String myLng) ;
	/*Lay Mang Place Mark trong file*/
	Osp::Base::Collection::LinkedListT<DiaChi>*getLayMangDiaChiBangTenDiaDiemHoacToaDo(char * giatri);

};

#endif /* MYPARSERXML_H_ */
